<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="./js/jquery-3.1.0.min.js"></script>
    <script src="./js/flexible.debug.js"></script>
    <script src="./js/flexible_css.debug.js"></script>
    <link rel="stylesheet" href="./css/redPack.css">
    <title>福利大抽奖</title>
</head>
<body>
    <div class="container">
        <img src="./image/code.jpg" alt="" class="logo" />
        <div class="money-box">
            金额(元) <input type="number" id="number" />
        </div>
        <ul class="choose" id="choose">
            <li class="item" value=1.08>￥1.08</li>
            <li class="item" value="1.28">￥1.28</li>
            <li class="item" value="1.38">￥1.38</li>
            <li class="item" value="1.88">￥1.88</li>
        </ul>
        <textarea cols="30" rows="5" placeholder="说点什么..." class="desc" id="description"></textarea>
        <input type="button" value="塞进红包" class="send" onclick="send()"/>
        <input type="button" value="发送记录" class="record" onclick="javascript:;location.href='record.html'"/>
        <!-- <footer>
            <p class="infer">娱乐有度 勿侵隐私</p>
            <p class="anounce">技术支持 @ 拼多多红包技术团队</p>
        </footer> -->
    </div>
    <script>
    $('#choose').click(function(event){
        reset();
        $(event.target).addClass('selected');
        $(this).attr('value',$(event.target).text().split('￥')[1]);
    });
    var reset = function(){
        console.log(123);
        var list = $('#choose').find('li');
        console.log(list);
        for ( var i = 0; i < list.length; i++) {
            console.log($(list[i]));
            $(list[i])[0].className = 'item';
        }
    }
    
    var send = function(){
        var price = Number($('#choose').attr('value'));
        var desc = $('#description').val();
        $.ajax({
            url: '',
            type: 'post',
            contentType: 'application/json',
            success: function(res) {
                console(res);
            }
        });
    }
    </script>
</body>
</html>